<template>
	<view class="ys-page">
		<view class="list">
			<view class="item" v-for="(item,index) in list" :key="index"
				@click="toPage(`./tenantdetail?id=${item.id}`)">
				<view class="top">
					<view class="imgbox">
						<image src="/static/0.png" mode="aspectFill"></image>
					</view>
					<view class="info">
						<view class="name">
							报警人 <text>男</text> <text>16</text>
						</view>
						<view class="phone">
							15311110000
						</view>
						<view class="phone">
							1561651965135196135
						</view>

					</view>
					<view class="right">
						<button>排查</button>
					</view>
				</view>
				<view class="bot">
					<view class="phone">
						报警地址：江苏省苏州书姑苏区14栋2903室
					</view>
					<view class="phone">
						报警时间：2024-08-26 14:04
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		audit
	} from "@/api/system.js"
	export default {
		data() {
			return {
				page: 1,
				last_page: 1,
				list: [1, 2, 3],
				pageSize: 15
			}
		},
		onLoad() {
			this.audit()
		},
		methods: {
			audit() {
				audit({
					page: this.page,
					pageSize: this.pageSize,
					status: this.status
				}).then(res => {
					if (res.code == 200) {
						this.list = this.list.concat(res.data.records)
						this.last_page = res.data.pages
					}
				})
			}

		}
	}
</script>

<style lang="scss">
	.list {
		padding: 10px;

		.item {
			background: #fff;
			margin-bottom: 10px;
			border-radius: 8px;
			padding: 5px;

			.top {
				display: flex;
				align-items: center;
			}

			.bot {
				font-size: 14px;

				.phone {
					padding: 5px 0;
				}
			}

			image {
				width: 80px;
				height: 80px;
			}

			.info {
				width: calc(100% - 140px);
				padding-left: 10px;
				box-sizing: border-box;

				.name {
					font-weight: bold;
					display: flex;
					align-items: center;
					font-size: 15px;

					text {
						margin-left: 5px;
						font-weight: normal;
						font-size: 12px;
					}
				}

				.phone {
					font-size: 13px;
					margin-top: 5px;
				}
			}

			.right {
				button {
					font-size: 12px;
					width: 60px;
					background: #f00;
					color: #fff;
				}
			}

		}
	}
</style>